package com.lzb.browser.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.lzb.browser.R;
import com.lzb.browser.basic.ProviderMultiAdapter;
import com.lzb.browser.bean.HomeBean;

public class HotAdapter extends ProviderMultiAdapter<HomeBean> {

    public HotAdapter() {
        addItemProvider(new HotProvider());
    }

    private class HotProvider extends BaseItemProvider<HomeBean> {
        @Override
        public int getItemViewType() {
            return ProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_hot;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, HomeBean bean) {
            baseViewHolder.setImageResource(R.id.ivHotItemImg, bean.getImg());
            baseViewHolder.setText(R.id.tvHotItemName, bean.getName());
        }
    }

}
